<!DOCTYPE html>
<html lang = "en">
<head>
	<meta charset = "UTF-8">
	<title>Menu toggle</title>
	<link rel = "stylesheet" type = "text/css" href = "style.css">
</head>
<body>
<div id = "toggle"></div>
<script>
	const toggle = document.getElementById('toggle');

	toggle.onclick = () => {
		// DOMTokenList接口的toggle()方法从列表中删除给定的token并返回false 。
		// 如果token不存在，则添加它并且函数返回true 。
		toggle.classList.toggle('active')
	}

</script>
</body>
</html>
